package com.huilang.stream.demo1;

import java.util.ArrayList;
import java.util.Collections;

/**
 * 终结方法
 */
public class StreamDemo2 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list, "a", "b", "c", "d", "e", "f", "g", "h");
        list.forEach(System.out::println);


        System.out.println("======");


        System.out.println(list.stream().count());
        System.out.println("======");

        String[] array = list.stream().toArray(v -> new String[v]);


    }
}
